home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 8302 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.2 KB  |  51 lines

  1. Path: news2.EUnet.fr!enst!orfanos
  2. From: orfanos@ima.enst.fr
  3. Newsgroups: comp.lang.c++
  4. Subject: const's and Borland C++
  5. Date: 16 Feb 1996 18:03:52 GMT
  6. Organization: ENST - France
  7. Sender: orfanos@news.enst.fr (Dimitri Papadopoulos Orfanos)
  8. Distribution: world
  9. Message-ID: <4g2gu8$hpe@enst.enst.fr>
  10. NNTP-Posting-Host: mathieu-2.enst.fr
  11. Mime-Version: 1.0
  12. Content-Type: text/plain; charset=iso-8859-1
  13. Content-Transfer-Encoding: 8bit
  14.  
  15.  
  16. Hello,
  17.  
  18. What's going here on with float const's and Borland C++ 4.5?
  19.  
  20.     --- MAGWEG.H ---
  21.     const float FOO1 = 23.0;
  22.     const float FOO2 = -62.33;
  23.  
  24.     --- MAGWEG.CPP ---
  25.     #include "magweg.h"
  26.     
  27.     int main()
  28.     {
  29.         float f = FOO1;
  30.         f /= 2;
  31.     
  32.        return 0;
  33.     }
  34.  
  35.     --- compiler messages ---
  36.     Compiling MAGWEG.CPP:
  37.     Warning MAGWEG.H 1: Cannot create pre-compiled header:
  38.                                   initialized data in header
  39.     Warning MAGWEG.CPP 11: 'FOO2' is declared but never used
  40.     Linking magweg.exe:
  41.  
  42. The first warning should not be emitted, because I disabled
  43. it in Options|Project|Messages|General.
  44. The second warning should never be emitted. In fact, it appears
  45. only with float const's, not with int const's!
  46.  
  47. Thank you for your help,
  48.  
  49. Dimitri Papadopoulos
  50. (orfanos@ima.enst.fr)
  51.